<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript"
	src="${res}/js/proposal/irisPrpPrepare.js"></script>
<title>申请书审核</title>
</head>
<body>
	<input type="hidden" id="childDiv" class="thickbox" />
	<form method="post" id="mainForm">
		<input type="hidden" id="prpCodes" name="prpCodes" value="" /> <input
			type="hidden" id="type" name="type" value="" />
	</form>
	<br />
	<div class="soBox">
		<div class="detail ico_search">
			<table>
				<tr>
					<td rowspan="2"><strong>检索条件：</strong></td>
					<td><cpt:search key="prpApprove_search" repeatColumn="3"
							displayCount="5" leftStyle="width:100px"></cpt:search></td>

				</tr>
				<tr>
					<td>
						<div class="clear_h10"></div> <input type='button' id='searchBt'
						class="button_an" value='查询' /></td>
				</tr>
			</table>
		</div>
	</div>
	<div class="clear_h10"></div>
	<div>
		<div id='TopBarMnt'></div>
		<table id='dataGrid'></table>
		<div id='dataBar'></div>
	</div>
	<script type="text/javascript">
		var irisGrid = new IrisGrid("dataGrid", "dataBar", 'TopBarMnt');
		var prcWin = new progressWin("${res}");//初始化遮罩层
		function showApproveDialog(type) {
			var prpCodes = "";

			$(":checkbox:checked").each(
					function() {
						var rowId = $(this).attr("id");
						var id = rowId.substring(rowId.lastIndexOf("_") + 1,
								rowId.length);//取出grid中需要的id
						if (id != null && id != "" && $.isNumeric(id))
							prpCodes = prpCodes + id + ",";
					});

			if (prpCodes == "") {
				scmError("请选择一条记录");
				return false;
			}

			var url = "${ctx}/prpapprove/openprpapprovedialog?prpCodes="
					+ prpCodes + "&type=" + type
					+ "&TB_iframe=true&height=220&width=400";
			var title = "申报审核意见（最多为500字）";
			showThickBox(url, title);

		}

		function closeDialog() {
			tb_remove();
		}
		function buildGrid() {
			var columnAttrList = new Array();
			var columnAttr = new ColumnAttr("申请代码", "subject_code",
					"subject_code", 4, "left", true);//表头，字段名，，，宽度比例，居左，是否需要表头排序
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("项目名称", "zh_title", "zh_title", 6,
					"left", true);//表头，字段名，，，宽度比例，居左，是否需要表头排序
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("申请人姓名", "psn_name", "psn_name", 4,
					"left", true);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("资助类别", "grant_name", "grant_name", 4,
					"left", true);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("科学部编号", "prp_no", "prp_no", 3, "left",
					false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("水印号", "prp_verson", "prp_verson", 3,
					"left", false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("依托单位", "org_name", "org_name", 3,
					"left", true);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("提交时间", "submitDate", "submitDate", 3,
					"left", false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("状态", "statusName", "statusName", 5,
					"center", false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("文档状态", "doc_status", "doc_status", 3,
					"left", false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("附件", "", "", 3, "center", false);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("status", "status", "status", 3,
					"left", false, false, "text", true);
			columnAttrList.push(columnAttr);
			columnAttr = new ColumnAttr("flagCan", "flagCan", "flagCan", 3,
					"left", false, false, "text", true);
			columnAttrList.push(columnAttr);
			irisGrid.setColumnAttrs(columnAttrList);
			irisGrid.setToolsBar([ //工具栏建按钮
				{
				id : 'return',
				name : '退回',
				trigger : function() {//按钮onclick方法
					showApproveDialog("return");
				}
			} ]);
			irisGrid
					.setUrl("${ctx}/prpapprove/list-for-xxzx?stat_year=${param.stat_year}");//查询url
			irisGrid.setCaption("暂写");
			irisGrid.setDefaultSortName("zh_title,prpseq");//默认排序字段
			irisGrid.setDefaultSortorder("asc");
			irisGrid.setWidth(978);//整个表格宽度
			irisGrid.setCheckAble(true);//表格左边是否要复选框
			irisGrid.setShowRowIndex(true);//是否显示行号
			irisGrid.setQueryBox('searchBt', 'prpApprove_search');//查询条件 按钮名，查询条件function_key
			irisGrid.build();
		}
		jQuery(function() {

			buildGrid();
		});
		/** 表格初始化**/
	</script>
</body>
</html>